import re

s = "Python is great!"
print(s[::-1])
print(s.count("t"))
print(s.replace(" ", "_"))
s2 = "A man,a plan,a canal,Panama!"
s3 = re.sub(r'[^a-zA-Z0-9]', '', s2).lower()
print(s3)
if s3 == s3[::-1]:
    print(True)

print(s.find("is"))
s4 = s[:s.find("t") + 1] + "_inserted" + s[s.find("t") + 1:]
print(s4)

print(s.replace(s[s.find("great"):s.find("great") + 5], "awesome"))

s5 = s[9:] + s[:9]
print(s5)

new_list = [i.capitalize() for i in s.split(" ")]
print(new_list)
s6 = "encryption"


def encrypt(n):
    map = {'a': 'm', 'b': 'n', 'c': 'o', 'd': 'p', 'e': 'q', 'f': 'r',
           'g': 's', 'h': 't', 'i': 'u', 'j': 'v', 'k': 'w', 'l': 'x',
           'm': 'y', 'n': 'z', 'o': 'a', 'p': 'b', 'q': 'c', 'r': 'd',
           's': 'e', 't': 'f', 'u': 'g', 'v': 'h', 'w': 'i', 'x': 'j',
           'y': 'k', 'z': 'l'
           }
    encrypted = ''.join(map[i] for i in s if i in map)
    return encrypted


s7 = encrypt(s6)
print(s7)
